package com.woniu.main.goods.service.imp;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import org.springframework.stereotype.Service;


import com.woniu.main.goods.service.GoodsAutoAuditService;
import com.woniu.main.util.Examine;
@Service
public class GoodsAutoAuditServiceImp implements GoodsAutoAuditService {
	
	//审核名称
	@Override
	public boolean autoAuditName(String goods_name) {
		
		return Examine.discernSensitiveWords(goods_name, null);
	}
	
	//审核描述
	@Override
	public boolean autoAuditTest(String goods_desc) {
		
		return Examine.discernSensitiveWords(goods_desc, null);
	}
	
	//审核图片
	@Override
	public boolean autoAuditPicture(String goods_pic) throws IOException {
	  InputStream inputStream = new FileInputStream(goods_pic);
	        byte[] b = new byte[inputStream.available()];
	        inputStream.read(b);
		return Examine.discernSensitiveImage(b);
	}

	

}
